<?php

namespace app\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * MarginRecord
 *
 * @ORM\Table(name="margin_record", uniqueConstraints={@ORM\UniqueConstraint(name="type", columns={"type", "uuid"}), @ORM\UniqueConstraint(name="type_to_cn", columns={"type_to_cn", "uuid"})}, indexes={@ORM\Index(name="user_id", columns={"user_id"}), @ORM\Index(name="create_time", columns={"create_time"})})
 * @ORM\Entity
 */
class MarginRecord
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true,"comment"="id"})
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="uuid", type="string", length=40, nullable=false, options={"fixed"=true,"comment"="唯一标识"})
     */
    private $uuid;

    /**
     * @var int
     *
     * @ORM\Column(name="user_id", type="integer", nullable=false, options={"unsigned"=true,"comment"="用户ID"})
     */
    private $userId;

    /**
     * @var int
     *
     * @ORM\Column(name="record_id", type="integer", nullable=false, options={"unsigned"=true,"comment"="产生本条流水的记录ID"})
     */
    private $recordId;

    /**
     * @var int
     *
     * @ORM\Column(name="type", type="integer", nullable=false, options={"unsigned"=true,"comment"="流水类型码1：充值，2：提现，3：放款，4：还款"})
     */
    private $type;

    /**
     * @var string
     *
     * @ORM\Column(name="type_to_cn", type="string", length=30, nullable=false, options={"comment"="流水类型"})
     */
    private $typeToCn;

    /**
     * @var string
     *
     * @ORM\Column(name="amount", type="decimal", precision=20, scale=2, nullable=false, options={"comment"="流水金额"})
     */
    private $amount;

    /**
     * @var string
     *
     * @ORM\Column(name="before_avaliable_amount", type="decimal", precision=20, scale=2, nullable=false, options={"comment"="操作之前可用余额"})
     */
    private $beforeAvaliableAmount;

    /**
     * @var string
     *
     * @ORM\Column(name="after_avaliable_amount", type="decimal", precision=20, scale=2, nullable=false, options={"comment"="操作之后可用余额"})
     */
    private $afterAvaliableAmount;

    /**
     * @var string|null
     *
     * @ORM\Column(name="remark", type="string", length=250, nullable=true, options={"comment"="备注"})
     */
    private $remark;

    /**
     * @var int
     *
     * @ORM\Column(name="status", type="smallint", nullable=false, options={"default"="200","unsigned"=true,"comment"="100处理中200成功 400失败"})
     */
    private $status = '200';

    /**
     * @var \DateTime|null
     *
     * @ORM\Column(name="update_time", type="datetime", nullable=true, options={"comment"="更新时间"})
     */
    private $updateTime;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="create_time", type="datetime", nullable=false, options={"comment"="创建时间"})
     */
    private $createTime;

    /**
     * @var bool|null
     *
     * @ORM\Column(name="is_affected_amount", type="boolean", nullable=true, options={"comment"="是否会影响可用余额"})
     */
    private $isAffectedAmount = '0';


}
